

            


            
using System;
using System.Collections.Generic;
using System.Web;
namespace DatabaseComponent
{
     public partial class Questions
     {

            //Write any additional methods or properties here 
            //Don't modify any genrated classes


         Courses _objCourses = null;

         public Courses objCourses
         {
             get {


                 if (CoursesID == -1)
                     return new Courses();

                 if (_objCourses == null)
                 {
                     CoursesDB objCoursesDB = new CoursesDB (ConnectionStrings.LMS);
                     List<Courses> lstCourses = objCoursesDB.getCoursesByID(CoursesID);
                     if (lstCourses.Count == 0)
                         return new Courses();

                     _objCourses = lstCourses[0];
                 }

                 
                 
                 
                 
                 return _objCourses; }
             
         }



         QuestionTypes _objQuestionTypes = null;

         public QuestionTypes objQuestionTypes
         {
             get {

                 if (QuestionTypesID == -1)
                     return new QuestionTypes();


                 if (_objQuestionTypes == null)
                 {
                     QuestionTypesDB objQuestionTypesDB = new QuestionTypesDB(ConnectionStrings.LMS);
                     List<QuestionTypes> lstQuestionTypes = objQuestionTypesDB.getQuestionTypesByID(QuestionTypesID);
                     if (lstQuestionTypes.Count == 0)
                         return new QuestionTypes();

                     _objQuestionTypes = lstQuestionTypes[0];
                 }
                 
                 
                 
                 
                 return _objQuestionTypes; }
             
         }



         List<QuestionsAnswers> _lstQuestionsAnswers = null;

         public List<QuestionsAnswers> lstQuestionsAnswers
         {
             get {

                 if (_lstQuestionsAnswers == null)
                 {
                     QuestionsAnswersDB objQuestionsAnswersDB = new QuestionsAnswersDB(ConnectionStrings.LMS);

                     _lstQuestionsAnswers = objQuestionsAnswersDB.getQuestionsAnswersByQuestionsID(ID);
                    
                 }
                             
                 
                 
                 
                 
                 
                 return _lstQuestionsAnswers; }
             
         }


         public void clearRelations()
         {
             _objCourses = null;
             _objQuestionTypes = null;
             _lstQuestionsAnswers = null;
         }



            






     }
}
